﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Collections;
using System.Net;
using System.Xml;
using System.Xml.Serialization;
using System.IO;

namespace OfficeClip.OpenSource.SpellO
{
	static class Program
	{
        public static Log log;
        /// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		static void Main(string[] args)
		{
			ServicePointManager.MaxServicePoints = 999999;
			ServicePointManager.DefaultConnectionLimit = 999999;

			log = new Log(Constants.GetSetupDir() + @"\log", 1);
			if (args.Length == 0)
			{
				Application.EnableVisualStyles();
				Application.SetCompatibleTextRenderingDefault(false);
				Application.Run(new Form1());
			}
			else
			{
                try
                {
                    WebCrawler.Run(0, null);
                }
                catch(Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
                //foreach (Result.Output output in WebCrawler.OutputList)
                //{
                //    log.WriteSubTitle("SpellO Url:", output.Url);
                //    foreach (Result.Mistake mistake in output.Mistakes)
                //    {
                //        log.WriteInfo(mistake.Error, mistake.Suggestions);
                //    }
                //}
			}
		}

	}
}
